<extend name="Base/common"/>
<block name="style">
    <link href="__CSS__/question.css" rel="stylesheet" type="text/css"/>
</block>
<block name="header">
    <include file="Public/nav"/>
</block>
<block name="body">
    <div class="col-xs-12">
        <div id="frm-post-popup" class="white-popup1 boxShadowBorder col-xs-9">
            <h2>{$edit_title}</h2>
            <div class="aline" style="margin-bottom: 10px"></div>
            <div class="row">
                <div class="col-xs-12">
                    <form class="form-horizontal ajax-form" role="form" action="{:U('Question/Index/edit')}" method="post">
                        <input type="hidden" name="id" id="id" value="{$data.id}"/>
                        <div class="form-group has-feedback">
                            <label for="title" class="col-xs-2 control-label">{:L("_TITLE_")}</label>

                            <div class="col-xs-8">
                                <input id="title" name="title" class="form-control form_check" check-type="Text" value="{$data.title}" placeholder={:L("_TITLE_WITH_DOUBLE_")}/>
                            </div>

                        </div>

                        <div class="form-group">
                            <label for="category" class="col-xs-2 control-label">{:L("_CLASSIFICATION_")}</label>

                            <div class="col-xs-5">

                                <select id="category" name="category" class="form-control">
                                    <volist name="category" id="top">
                                        <option value="{$top.id}" <eq name="data['category']" value="$top['id']"> selected</eq>>
                                        {$top.title}
                                        </option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">{:L("_SUPPLEMENTARY_DESCRIPTION_")}</label>

                            <div class="col-xs-10" >

                                <php>
                                    $config="toolbars:[['source','|','bold','italic','underline','fontsize','forecolor','justifyleft','fontfamily','|','map','emotion','insertimage','insertcode']]";
                                </php>

    {:W('Common/Ueditor/editor',array('myeditor_edit','description',$data['description'],'660px','250px',$config))}


                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-xs-1">
                                <button type="submit" class="btn btn-primary ">{:L("_SUBMIT_")}
                                </button>

                            </div>
                            <div class="col-xs-8">
                                <button type="button" onclick="history.go(-1);" class="btn btn-default ">{:L("_RETURN_")}
                                </button>
                            </div>

                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-xs-3">
            <div class="boxShadowBorder" style="padding: 10px;font-size: 18px;line-height: 30px;color: #BBB;">
                <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:L("_PLEASE_IN_THE_SEARCH_BOX_ABOVE_SEARCH_HAVE_A_LOOK_THERE_IS_NO_ASSOCIATED_PROBLEM_BEFORE_ASKING_A_QUESTION_YO_WITH_WAVE_")}</p>
                <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:L("_YOU_MIGHT_HAVE_THE_ANSWER_YOU_WANT_")}^_^~~</p>
            </div>
        </div>
    </div>

    <link href="__CORE_CSS__/form_check.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__CORE_JS__/form_check.js"></script>
    <script>
            $('#category').change(function () {
                var pid = $(this).val();
                var questionId ="{$data['id']}"
                    $.post("{:U('Question/index/selectContent')}", {pid: pid,questionId:questionId}, function (data) {
                        ue_myeditor_edit.setContent(data.info);
                    }, 'json');
            });

    </script>
</block>